home *** CD-ROM | disk | FTP | other *** search
/ Aminet 41 / Aminet 41 (2001)(Schatztruhe)[!][Feb 2001].iso / Aminet / comm / net / tf02.lha / TinyFugue / tf-lib / watch.tf < prev    next >
Text File  |  1995-08-12  |  838b  |  24 lines

  1. ;;; /watch <player>
  2. ; Tells you when <player> logs on to the mud.
  3. ; Requires that the mud have a "WHO" command that lists one player per line.
  4.  
  5. /~loaded watch.tf
  6. /require pcmd.tf
  7.  
  8. /def -i watch = \
  9.     /def -i _watch_%1 = \
  10.         /pcmd WHO %1%%;\
  11.         /def -i -p100 -1 -ag -msimple -t"%%{outputprefix}" = \
  12.             /def -i -p100 -ag -mglob -t"*" _watch_not_%1%%%;\
  13.             /def -i -p101 -ag -mglob -t"{%1}*" _watch_match_%1 = \
  14.                 /echo # %1 has connected.%%%%;\
  15.                 /kill $$$${_watch_pid_%1}%%%%;\
  16.                 /undef _watch_%1%%%%;\
  17.                 /undef _watch_pid_%1%%%;\
  18.             /def -i -p101 -1 -ag -msimple -t"%%{outputsuffix}" = \
  19.                 /undef _watch_not_%1%%%%;\
  20.                 /undef _watch_match_%1%;\
  21.     /repeat -60 99999 /_watch_%1%;\
  22.     /def -i _watch_pid_%1 = %?
  23.  
  24.